home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / PowerPlant / Hierarchical Lists / ListDemo.r < prev    next >
Encoding:
Text File  |  1995-10-24  |  6.8 KB  |  248 lines  |  [TEXT/MMCC]

  1. // Tells PowerPlant to add our own class templates
  2. #define Include_User_Template
  3. #define User_Template_File    "ListDemo.tmp"
  4. #define SystemSevenOrLater    1
  5.  
  6. #include "Types.r"
  7. #include "SysTypes.r"
  8. #include "PowerPlant.r"
  9.  
  10. #include "resources.h"
  11.  
  12. #define kGeneva10_Txtr        130
  13.  
  14. // ===========================================================================
  15. //        • Menu resources
  16. // ===========================================================================
  17.  
  18. resource 'MBAR' (128) {
  19.     {
  20.         128,        //    Apple
  21.         129            //    File
  22.     }
  23. };
  24.  
  25. resource 'MENU' (128) {
  26.     128, textMenuProc, allEnabled, enabled, apple,
  27.     {
  28.         "About List Demo…", noIcon, noKey, noMark, plain
  29.     }
  30. };
  31.  
  32. resource 'Mcmd' (128, "Apple") {
  33.     {
  34.         cmd_About
  35.     }
  36. };
  37.  
  38. resource 'MENU' (129) {
  39.     129, textMenuProc, 0x7FFFFB03, enabled, "File",
  40.     {
  41.         "Easy List", noIcon, noKey, noMark, plain,
  42.         "Custom List", noIcon, noKey, noMark, plain,
  43.         "Hierarchical List", noIcon, noKey, noMark, plain,
  44.         "Disk List", noIcon, noKey, noMark, plain,
  45.         "-", noIcon, noKey, noMark, plain,
  46.         "Quit", noIcon, "Q", noMark, plain
  47.     }
  48. };
  49.  
  50. resource 'Mcmd' (129, "File") {
  51.     {
  52.         cmd_EasyList,
  53.         cmd_CustomList,
  54.         cmd_HierList,
  55.         cmd_DiskList,
  56.         cmd_Nothing,
  57.         cmd_Quit
  58.     }
  59. };
  60.  
  61. // ===========================================================================
  62. //        • Window & Pane resources : Easy List
  63. // ===========================================================================
  64.  
  65. resource 'WIND' (EasyList_WIND, purgeable) {
  66.     { 47, 17, 247, 317 },
  67.     documentProc,                 // standard with size box & goAway
  68.     visible, goAway,
  69.     0x0,                        // refCon
  70.     "Easy List",
  71.     noAutoCenter
  72. };
  73.  
  74. resource 'PPob' (EasyList_PPob, purgeable) { {
  75.  
  76.     ObjectData { Window {
  77.         EasyList_WIND, regular, hasCloseBox, hasTitleBar, hasResize, hasSizeBox, noZoom, hasShowNew,
  78.         enabled, hasTarget, hasGetSelectClick, noHideOnSuspend, noDelaySelect, hasEraseOnUpdate,
  79.         100, 100,                    //    Minimum width, height
  80.         screenSize, screenSize,        //    Maximum width, height
  81.         screenSize, screenSize,        //    Standard width, height
  82.         0                            //    UserCon
  83.     } },
  84.  
  85.     BeginSubs {},
  86.  
  87.         ObjectData { ListBox {
  88.         1001, { 302, 202 }, visible, enabled,    // paneID, { width, height }
  89.         bound, bound, bound, bound,                // bound edges to superview
  90.         -1, -1, 0, defaultSuperView,            // left, top, userRefCon
  91.         hasHorizScroll, hasVertScroll, hasGrowBox, noFocusBox,
  92.         0, kGeneva10_Txtr,                        // double-click msg, text traits
  93.         textList,                                // LDEF ID
  94.         { "One", "Two", "Three", "Four", "Five" }    // some sample data
  95.         } },
  96.  
  97.     EndSubs {}
  98. } };
  99.  
  100. // ===========================================================================
  101. //        • Window & Pane resources : Custom List
  102. // ===========================================================================
  103.  
  104. resource 'WIND' (CustomList_WIND, purgeable) {
  105.     { 47, 17, 247, 317 },
  106.     documentProc,                 // standard with size box & goAway
  107.     visible, goAway,
  108.     0x0,                        // refCon
  109.     "Custom List",
  110.     noAutoCenter
  111. };
  112.  
  113. resource 'PPob' (CustomList_PPob, purgeable) { {
  114.  
  115.     ObjectData { Window {
  116.         CustomList_WIND, regular, hasCloseBox, hasTitleBar, hasResize, hasSizeBox, noZoom, hasShowNew,
  117.         enabled, hasTarget, hasGetSelectClick, noHideOnSuspend, noDelaySelect, hasEraseOnUpdate,
  118.         100, 100,                    //    Minimum width, height
  119.         screenSize, screenSize,        //    Maximum width, height
  120.         screenSize, screenSize,        //    Standard width, height
  121.         0                            //    UserCon
  122.     } },
  123.  
  124.     BeginSubs {},
  125.  
  126.         ClassAlias { 'mlst' },
  127.         ObjectData { ListBox {
  128.         1001, { 302, 202 }, visible, enabled,    // paneID, { width, height }
  129.         bound, bound, bound, bound,            // bound edges to superview
  130.         -1, -1, 0, defaultSuperView,        // left, top, userRefCon
  131.         hasHorizScroll, hasVertScroll, hasGrowBox, noFocusBox,
  132.         0, kGeneva10_Txtr,                    // double-click msg, text traits
  133.         caller_LDEF,                        // LDEF ID
  134.         {  }                                // empty list
  135.         } },
  136.  
  137.     EndSubs {}
  138. } };
  139.  
  140. // ===========================================================================
  141. //        • Window & Pane resources : Hierarchical Demo List
  142. // ===========================================================================
  143.  
  144. resource 'WIND' (HierList_WIND, purgeable) {
  145.     { 47, 17, 247, 317 },
  146.     documentProc,                 // standard with size box & goAway
  147.     visible, goAway,
  148.     0x0,                        // refCon
  149.     "Hierarchical List",
  150.     noAutoCenter
  151. };
  152.  
  153. resource 'PPob' (HierList_PPob, purgeable) { {
  154.  
  155.     ObjectData { Window {
  156.         HierList_WIND, regular, hasCloseBox, hasTitleBar, hasResize, hasSizeBox, noZoom, hasShowNew,
  157.         enabled, hasTarget, hasGetSelectClick, noHideOnSuspend, noDelaySelect, hasEraseOnUpdate,
  158.         100, 100,                    //    Minimum width, height
  159.         screenSize, screenSize,        //    Maximum width, height
  160.         screenSize, screenSize,        //    Standard width, height
  161.         0                            //    UserCon
  162.     } },
  163.  
  164.     BeginSubs {},
  165.  
  166.         ClassAlias { 'Hlst' },
  167.         ObjectData { ListBox {
  168.         1001, { 302, 202 }, visible, enabled,    // paneID, { width, height }
  169.         bound, bound, bound, bound,            // bound edges to superview
  170.         -1, -1, 0, defaultSuperView,        // left, top, userRefCon
  171.         hasHorizScroll, hasVertScroll, hasGrowBox, noFocusBox,
  172.         0, kGeneva10_Txtr,                    // double-click msg, text traits
  173.         caller_LDEF,                        // LDEF ID
  174.         {  }                                // empty list
  175.         } },
  176.  
  177.     EndSubs {}
  178. } };
  179.  
  180. // ===========================================================================
  181. //        • Window & Pane resources : Hierarchical Demo List
  182. // ===========================================================================
  183.  
  184. resource 'WIND' (DiskList_WIND, purgeable) {
  185.     { 47, 17, 247, 317 },
  186.     documentProc,                 // standard with size box & goAway
  187.     visible, goAway,
  188.     0x0,                        // refCon
  189.     "Disk List",
  190.     noAutoCenter
  191. };
  192.  
  193. resource 'PPob' (DiskList_PPob, purgeable) { {
  194.  
  195.     ObjectData { Window {
  196.         DiskList_WIND, regular, hasCloseBox, hasTitleBar, hasResize, hasSizeBox, noZoom, hasShowNew,
  197.         enabled, hasTarget, hasGetSelectClick, noHideOnSuspend, noDelaySelect, hasEraseOnUpdate,
  198.         100, 100,                    //    Minimum width, height
  199.         screenSize, screenSize,        //    Maximum width, height
  200.         screenSize, screenSize,        //    Standard width, height
  201.         0                            //    UserCon
  202.     } },
  203.  
  204.     BeginSubs {},
  205.  
  206.         ObjectData { DiskListBox {
  207.         1001, { 302, 202 }, visible, enabled,    // paneID, { width, height }
  208.         bound, bound, bound, bound,            // bound edges to superview
  209.         -1, -1, 0, defaultSuperView,        // left, top, userRefCon
  210.         hasHorizScroll, hasVertScroll, hasGrowBox, noFocusBox,
  211.         0, kGeneva10_Txtr,                    // double-click msg, text traits
  212.         caller_LDEF,                        // LDEF ID
  213.         {  }                                // empty list
  214.         } },
  215.  
  216.     EndSubs {}
  217. } };
  218.  
  219.  
  220. // ===========================================================================
  221. //        • Text style resources
  222. // ===========================================================================
  223.  
  224. resource 'Txtr' (kGeneva10_Txtr, "Geneva 10") {
  225.     10,
  226.     0,
  227.     flushDefault,
  228.     srcOr,
  229.     0,
  230.     0,
  231.     0,
  232.     useName,
  233.     "Geneva"
  234. };
  235.  
  236. // ===========================================================================
  237. //        • Apple Event-related resources
  238. // ===========================================================================
  239.  
  240. resource 'aedt' (128, "Required Suite") {
  241.     {
  242.         'aevt', 'oapp', 1001,
  243.         'aevt', 'odoc', 1002,
  244.         'aevt', 'pdoc', 1003,
  245.         'aevt', 'quit', 1004
  246.     }
  247. };
  248.